﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PetaPoco;

namespace BrnMall.Manager.Domain.User
{

    /// <summary>
    /// 会员余额
    /// </summary>
    [TableName("cash_usercash")]
    public class UserCash
    {
        public int id { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public int Uid { get; set; }

        /// <summary>
        /// 余额
        /// </summary>
        public string Cash { get; set; }
        /// <summary>
        /// 赠送总金额
        /// </summary>
        public decimal GiveCash { get; set; }

        /// <summary>
        /// 明文的余额，只做显示，无其它作用
        /// </summary>
        public decimal Cash_Decode { get; set; }

        public int StoreId { get; set; }
    }

    /// <summary>
    /// 商户的充值赠送项目
    /// </summary>
    [TableName("cash_cashitem")]
    public class CashItem
    {
        public int id { get; set; }
        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        /// 充值金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 赠送金额
        /// </summary>
        public decimal GiveAmount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 状态 1可用，2 停用
        /// </summary>
        public int state { get; set; }

        /// <summary>
        /// 赠送项目的主题
        /// </summary>
        public string Title { get; set; }

        public string remark { get; set; }
    }

    /// <summary>
    /// 充值订单记录
    /// </summary>
    [TableName("cash_cashorder")]
    public class CashOrder
    {
        public int id { get; set; }
        /// <summary>
        /// 会员ID
        /// </summary>
        public int Uid { get; set; }
        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; }

        /// <summary>
        /// 赠送项目ID(没有则 0标识)
        /// </summary>
        public int CashItemId { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string OSN { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public int OrderState { get; set; }
        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmount { get; set; }

        /// <summary>
        /// 赠送金额
        /// </summary>
        public decimal GiveAmount { get; set; }

        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 支付单号
        /// </summary>
        public string paySN { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public string payTime { get; set; }
        /// <summary>
        /// 预支付ID
        /// </summary>
        public string prepay_id { get; set; }

        /// <summary>
        /// 客户端IP地址
        /// </summary>
        public string IP { get; set; }
    }

    [TableName("cash_cashrecord")]
    public class CashRecord
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public int Uid { get; set; }
        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; }
        /// <summary>
        /// 资金流向 (1 收入,2 支出)
        /// </summary>
        public int Direction { get; set; }

        /// <summary>
        /// 交易金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 赠送金额
        /// </summary>
        public decimal GiveAmount { get; set; }

        /// <summary>
        /// 当笔交易后的余额
        /// </summary>
        public decimal Balance { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string remark { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }

    /// <summary>
    /// 财务统计实体
    /// </summary>
    public class TotalMoneyModel
    {
        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal OrderAmount { get; set; }
        /// <summary>
        /// 剩余支付
        /// </summary>
        public decimal SurplusMoney { get; set; }
        /// <summary>
        /// 积分金额
        /// </summary>
        public decimal PayCreditMoney { get; set; }
        /// <summary>
        /// 优惠劵金额
        /// </summary>
        public decimal CouponMoney { get; set; }
        /// <summary>
        /// 满减
        /// </summary>
        public decimal FullCut { get; set; }
        /// <summary>
        /// 余额支付
        /// </summary>
        public decimal PayCash { get; set; }
    }
}